import java.util.Scanner;

public class Test {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();

        int index = str.lastIndexOf(' ');//找到空格的位置
        String temp = str.substring(index+1);//返回从空格后第一个子字符串
        System.out.println(temp +  ' '+ temp.length());
    }

}
